package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2023-10-18
 * Time: 17:50
 */
public class Test4 {
    public static void main(String[] args) {
        double sum = 0;
        int flg = 1;
        for (int i = 0; i < 101; i++) {
            sum = sum + flg * 1* 1.0/i;
            flg = -flg;
        }
        System.out.println(sum);
    }
}
